package com.tulingxueyuan.stock.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tulingxueyuan.stock.pojo.Stock;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * @Author li
 * @Date 2025/4/26 18:04
 * @description: TODO
 */
@Repository
public interface StockMapper extends BaseMapper<Stock> {

    @Update("update stock_tbl set count = count - 1 where product_id = #{productId}")
    void reduce(@Param("productId") Long productId);

}
